<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"emoh.xyz","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta property="og:type" content="website">
<meta property="og:title" content="Just do it!">
<meta property="og:url" content="http://emoh.xyz/index.html">
<meta property="og:site_name" content="Just do it!">
<meta property="og:locale" content="zh_CN">
<meta property="article:author" content="Emoh">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://emoh.xyz/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : true,
    isPost : false,
    lang   : 'zh-CN'
  };
</script>

  <title>Just do it!</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Just do it!</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content index posts-expand">
            
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://emoh.xyz/2020/06/03/2020-06-03-SSM%E6%93%8D%E4%BD%9C%E7%A4%BA%E4%BE%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/touxiang.png">
      <meta itemprop="name" content="Emoh">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Just do it!">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/06/03/2020-06-03-SSM%E6%93%8D%E4%BD%9C%E7%A4%BA%E4%BE%8B/" class="post-title-link" itemprop="url">2020-06-03-SSM操作示例</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-03 17:11:31 / 修改时间：17:13:06" itemprop="dateCreated datePublished" datetime="2020-06-03T17:11:31+08:00">2020-06-03</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux%E5%A5%87%E6%B7%AB%E6%8A%80%E5%B7%A7/" itemprop="url" rel="index"><span itemprop="name">Linux奇淫技巧</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br></pre></td><td class="code"><pre><span class="line">Quick examples</span><br><span class="line">List system storage:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm list</span></span><br><span class="line">----------------------------------</span><br><span class="line">Device          Total  Mount point</span><br><span class="line">----------------------------------</span><br><span class="line">/dev/loop0    5.00 GB</span><br><span class="line">/dev/loop1    5.00 GB</span><br><span class="line">/dev/loop2    5.00 GB</span><br><span class="line">/dev/loop3    5.00 GB</span><br><span class="line">/dev/loop4    5.00 GB</span><br><span class="line">/dev/sda    149.05 GB  PARTITIONED</span><br><span class="line">/dev/sda1    19.53 GB  /</span><br><span class="line">/dev/sda2    78.12 GB</span><br><span class="line">/dev/sda3     1.95 GB  SWAP</span><br><span class="line">/dev/sda4     1.00 KB</span><br><span class="line">/dev/sda5    49.44 GB  /mnt/<span class="built_in">test</span></span><br><span class="line">----------------------------------</span><br><span class="line">------------------------------------------------------------------------------</span><br><span class="line">Volume     Pool      Volume size  FS     FS size      Free  Type   Mount point</span><br><span class="line">------------------------------------------------------------------------------</span><br><span class="line">/dev/dm-0  dm-crypt     78.12 GB  ext4  78.12 GB  45.01 GB  crypt  /home</span><br><span class="line">/dev/sda1               19.53 GB  ext4  19.53 GB  12.67 GB  part   /</span><br><span class="line">/dev/sda5               49.44 GB  ext4  49.44 GB  29.77 GB  part   /mnt/<span class="built_in">test</span></span><br><span class="line">------------------------------------------------------------------------------</span><br><span class="line">Creating a volume of defined size with the defined file system. The default back-end is <span class="built_in">set</span> to lvm and lvm default pool name is lvm_pool:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm create --fs ext4 -s 15G /dev/loop0 /dev/loop1</span></span><br><span class="line">The name of the new volume is ‘/dev/lvm_pool/lvol001’. Resize the volume to 10GB:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm resize -s-5G /dev/lvm_pool/lvol001</span></span><br><span class="line">Resize the volume to 100G, but it would require to add more devices into the pool:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm resize -s 25G /dev/lvm_pool/lvol001 /dev/loop2</span></span><br><span class="line">Now we can try to create new lvm volume named ‘myvolume’ from the remaining pool space with xfs file system and mount it to /mnt/test1:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm create --fs xfs --name myvolume /mnt/test1</span></span><br><span class="line">List all volumes with file system:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm list filesystems</span></span><br><span class="line">-----------------------------------------------------------------------------------------------</span><br><span class="line">Volume                  Pool        Volume size  FS      FS size      Free  Type    Mount point</span><br><span class="line">-----------------------------------------------------------------------------------------------</span><br><span class="line">/dev/lvm_pool/lvol001   lvm_pool       25.00 GB  ext4   25.00 GB  23.19 GB  linear</span><br><span class="line">/dev/lvm_pool/myvolume  lvm_pool        4.99 GB  xfs     4.98 GB   4.98 GB  linear  /mnt/test1</span><br><span class="line">/dev/dm-0               dm-crypt       78.12 GB  ext4   78.12 GB  45.33 GB  crypt   /home</span><br><span class="line">/dev/sda1                              19.53 GB  ext4   19.53 GB  12.67 GB  part    /</span><br><span class="line">/dev/sda5                              49.44 GB  ext4   49.44 GB  29.77 GB  part    /mnt/<span class="built_in">test</span></span><br><span class="line">-----------------------------------------------------------------------------------------------</span><br><span class="line">You can <span class="keyword">then</span> easily remove the old volume by:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm remove /dev/lvm_pool/lvol001</span></span><br><span class="line">Now lest try to create btrfs volume. Btrfs is separate backend, not just a file system. That is because btrfs itself have integrated volume manager. Defaul btrfs pool name is btrfs_pool.:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm -b btrfs create /dev/loop3 /dev/loop4</span></span><br><span class="line">Now create we btrfs subvolumes. Note that btrfs file system has to be mounted <span class="keyword">in</span> order to create subvolumes. However ssm will handle it <span class="keyword">for</span> you.:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm create -p btrfs_pool</span></span><br><span class="line"><span class="comment"># ssm create -n new_subvolume -p btrfs_pool</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm list filesystems</span></span><br><span class="line">-----------------------------------------------------------------</span><br><span class="line">Device         Free      Used      Total  Pool        Mount point</span><br><span class="line">-----------------------------------------------------------------</span><br><span class="line">/dev/loop0  0.00 KB  10.00 GB   10.00 GB  lvm_pool</span><br><span class="line">/dev/loop1  0.00 KB  10.00 GB   10.00 GB  lvm_pool</span><br><span class="line">/dev/loop2  0.00 KB  10.00 GB   10.00 GB  lvm_pool</span><br><span class="line">/dev/loop3  8.05 GB   1.95 GB   10.00 GB  btrfs_pool</span><br><span class="line">/dev/loop4  6.54 GB   1.93 GB    8.47 GB  btrfs_pool</span><br><span class="line">/dev/sda                       149.05 GB              PARTITIONED</span><br><span class="line">/dev/sda1                       19.53 GB              /</span><br><span class="line">/dev/sda2                       78.12 GB</span><br><span class="line">/dev/sda3                        1.95 GB              SWAP</span><br><span class="line">/dev/sda4                        1.00 KB</span><br><span class="line">/dev/sda5                       49.44 GB              /mnt/<span class="built_in">test</span></span><br><span class="line">-----------------------------------------------------------------</span><br><span class="line">-------------------------------------------------------</span><br><span class="line">Pool        Type   Devices     Free      Used     Total</span><br><span class="line">-------------------------------------------------------</span><br><span class="line">lvm_pool    lvm    3        0.00 KB  29.99 GB  29.99 GB</span><br><span class="line">btrfs_pool  btrfs  2        3.84 MB  18.47 GB  18.47 GB</span><br><span class="line">-------------------------------------------------------</span><br><span class="line">-----------------------------------------------------------------------------------------------</span><br><span class="line">Volume                  Pool        Volume size  FS      FS size      Free  Type    Mount point</span><br><span class="line">-----------------------------------------------------------------------------------------------</span><br><span class="line">/dev/lvm_pool/lvol001   lvm_pool       25.00 GB  ext4   25.00 GB  23.19 GB  linear</span><br><span class="line">/dev/lvm_pool/myvolume  lvm_pool        4.99 GB  xfs     4.98 GB   4.98 GB  linear  /mnt/test1</span><br><span class="line">/dev/dm-0               dm-crypt       78.12 GB  ext4   78.12 GB  45.33 GB  crypt   /home</span><br><span class="line">btrfs_pool              btrfs_pool     18.47 GB  btrfs  18.47 GB  18.47 GB  btrfs</span><br><span class="line">/dev/sda1                              19.53 GB  ext4   19.53 GB  12.67 GB  part    /</span><br><span class="line">/dev/sda5                              49.44 GB  ext4   49.44 GB  29.77 GB  part    /mnt/<span class="built_in">test</span></span><br><span class="line">-----------------------------------------------------------------------------------------------</span><br><span class="line">Now <span class="built_in">let</span>’s free up some of the loop devices so we cat try to add them into <span class="keyword">then</span> btrfs_pool. So we’ll simply remove lvm mvolume and resize lvol001 so we can remove /dev/loop2. Note that myvolume is mounted so we have to unmount it first.:</span><br><span class="line"></span><br><span class="line"><span class="comment"># umount /mnt/test1</span></span><br><span class="line"><span class="comment"># ssm remove /dev/lvm_pool/myvolume</span></span><br><span class="line"><span class="comment"># ssm resize -s-10G /dev/lvm_pool/lvol001</span></span><br><span class="line"><span class="comment"># ssm remove /dev/loop2</span></span><br><span class="line">Add device to the btrfs file system:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm add /dev/loop2 -p btrfs_pool</span></span><br><span class="line">Set’ see what happend. Note that to actually see btrfs subvolumes you have to mount the file system first:</span><br><span class="line"></span><br><span class="line"><span class="comment"># mount -L btrfs_pool /mnt/test1/</span></span><br><span class="line"><span class="comment"># ssm list volumes</span></span><br><span class="line">------------------------------------------------------------------------------------------------------------------------</span><br><span class="line">Volume                         Pool        Volume size  FS      FS size      Free  Type    Mount point</span><br><span class="line">------------------------------------------------------------------------------------------------------------------------</span><br><span class="line">/dev/lvm_pool/lvol001          lvm_pool       15.00 GB  ext4   15.00 GB  13.85 GB  linear</span><br><span class="line">/dev/dm-0                      dm-crypt       78.12 GB  ext4   78.12 GB  45.33 GB  crypt   /home</span><br><span class="line">btrfs_pool                     btrfs_pool     28.47 GB  btrfs  28.47 GB  28.47 GB  btrfs   /mnt/test1</span><br><span class="line">btrfs_pool:2012-05-09-T113426  btrfs_pool     28.47 GB  btrfs  28.47 GB  28.47 GB  btrfs   /mnt/test1/2012-05-09-T113426</span><br><span class="line">btrfs_pool:new_subvolume       btrfs_pool     28.47 GB  btrfs  28.47 GB  28.47 GB  btrfs   /mnt/test1/new_subvolume</span><br><span class="line">/dev/sda1                                     19.53 GB  ext4   19.53 GB  12.67 GB  part    /</span><br><span class="line">/dev/sda5                                     49.44 GB  ext4   49.44 GB  29.77 GB  part    /mnt/<span class="built_in">test</span></span><br><span class="line">------------------------------------------------------------------------------------------------------------------------</span><br><span class="line">Remove the whole lvm pool and one of the btrfs subvolume, and one unused device from the btrfs pool btrfs_loop3. Note that with btrfs, pool have the same name as the volume:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm remove lvm_pool /dev/loop2 /mnt/test1/new_subvolume/</span></span><br><span class="line">Snapshots can also be <span class="keyword">done</span> with ssm:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm snapshot btrfs_pool</span></span><br><span class="line"><span class="comment"># ssm snapshot -n btrfs_snapshot btrfs_pool</span></span><br><span class="line">With lvm, you can also create snapshots:</span><br><span class="line"></span><br><span class="line">root<span class="comment"># ssm create -s 10G /dev/loop[01]</span></span><br><span class="line"><span class="comment"># ssm snapshot /dev/lvm_pool/lvol001</span></span><br><span class="line">Now list all snapshots. Note that btrfs snapshots are actually just subvolumes with some blocks shared with the original subvolume, so there currently no way to distinguish between those. ssm is using a little trick to search <span class="keyword">for</span> name patters to recognize snapshots, so <span class="keyword">if</span> you specify your own name <span class="keyword">for</span> the snapshot ssm will not recognize it as snapshot, but rather as regular volume (subvolume). This problem does not exist with lvm.:</span><br><span class="line"></span><br><span class="line"><span class="comment"># ssm list snapshots</span></span><br><span class="line">-------------------------------------------------------------------------------------------------------------</span><br><span class="line">Snapshot                            Origin   Volume size     Size  Type    Mount point</span><br><span class="line">-------------------------------------------------------------------------------------------------------------</span><br><span class="line">/dev/lvm_pool/snap20120509T121611   lvol001      2.00 GB  0.00 KB  linear</span><br><span class="line">btrfs_pool:snap-2012-05-09-T121313              18.47 GB           btrfs   /mnt/test1/snap-2012-05-09-T121313</span><br><span class="line">-------------------------------------------------------------------------------------------------------------</span><br></pre></td></tr></table></figure>


      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://emoh.xyz/2020/06/03/2020-06-03-oracle%E6%9F%A5%E8%AF%A2session%E7%9A%84%E7%AD%89%E5%BE%85%E4%BA%8B%E4%BB%B6/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/touxiang.png">
      <meta itemprop="name" content="Emoh">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Just do it!">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/06/03/2020-06-03-oracle%E6%9F%A5%E8%AF%A2session%E7%9A%84%E7%AD%89%E5%BE%85%E4%BA%8B%E4%BB%B6/" class="post-title-link" itemprop="url">2020-06-03-oracle查询session的等待事件</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-03 11:43:18 / 修改时间：11:44:55" itemprop="dateCreated datePublished" datetime="2020-06-03T11:43:18+08:00">2020-06-03</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/oracle-%E6%97%A5%E5%B8%B8%E7%AE%A1%E7%90%86/" itemprop="url" rel="index"><span itemprop="name">oracle 日常管理</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h1 id="查询session的相关信息"><a href="#查询session的相关信息" class="headerlink" title="查询session的相关信息"></a>查询session的相关信息</h1><ul>
<li>查看等待事件</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">select</span></span><br><span class="line">    <span class="keyword">event</span>,</span><br><span class="line">    <span class="keyword">sum</span>(<span class="keyword">decode</span>(wait_Time, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>)) <span class="string">"Prev"</span>,</span><br><span class="line">    <span class="keyword">sum</span>(<span class="keyword">decode</span>(wait_Time, <span class="number">0</span>, <span class="number">1</span>, <span class="number">0</span>)) <span class="string">"Curr"</span>,</span><br><span class="line">    <span class="keyword">count</span>(*) <span class="string">"Tot"</span></span><br><span class="line"><span class="keyword">from</span></span><br><span class="line">    v $ session_Wait</span><br><span class="line"><span class="keyword">group</span> <span class="keyword">by</span></span><br><span class="line">    <span class="keyword">event</span></span><br><span class="line"><span class="keyword">order</span> <span class="keyword">by</span></span><br><span class="line">    <span class="number">4</span>;</span><br></pre></td></tr></table></figure>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/06/03/2020-06-03-oracle%E6%9F%A5%E8%AF%A2session%E7%9A%84%E7%AD%89%E5%BE%85%E4%BA%8B%E4%BB%B6/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://emoh.xyz/2020/06/03/2020-06-03-zabbix%E6%95%B0%E6%8D%AE%E5%BA%93%E5%A4%87%E4%BB%BD/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/touxiang.png">
      <meta itemprop="name" content="Emoh">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Just do it!">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/06/03/2020-06-03-zabbix%E6%95%B0%E6%8D%AE%E5%BA%93%E5%A4%87%E4%BB%BD/" class="post-title-link" itemprop="url">2020-06-03-zabbix数据库备份</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-03 11:40:25 / 修改时间：11:41:02" itemprop="dateCreated datePublished" datetime="2020-06-03T11:40:25+08:00">2020-06-03</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/zabbix/" itemprop="url" rel="index"><span itemprop="name">zabbix</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h1 id="zabbix数据库备份"><a href="#zabbix数据库备份" class="headerlink" title="zabbix数据库备份"></a>zabbix数据库备份</h1><ul>
<li>示例</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">mysqldump zabbix | bzip2 -9 &gt; dbdump.bz2</span><br><span class="line"></span><br><span class="line">mysqldump -uroot -p zabbix | bzip2 -9 &gt; 20190118.dbdump.bz2</span><br></pre></td></tr></table></figure>

<ul>
<li>备份配置</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysqldump -uroot -p --databases zabbix --ignore-table=zabbix.alerts --ignore-table=zabbix.auditlog --ignore-table=zabbix.events --ignore-table=zabbix.history --ignore-table=zabbix.history_log --ignore-table=zabbix.history_str --ignore-table=zabbix.history_str_sync --ignore-table=zabbix.history_sync --ignore-table=zabbix.history_text --ignore-table=zabbix.history_uint --ignore-table=zabbix.history_uint_sync --ignore-table=zabbix.node_cksum --ignore-table=zabbix.proxy_dhistory --ignore-table=zabbix.proxy_history --ignore-table=zabbix.service_alarms --ignore-table=zabbix.services_times --ignore-table=zabbix.trends --ignore-table=zabbix.trends_uint &gt; zabbix_config.sql</span><br></pre></td></tr></table></figure>
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://emoh.xyz/2020/06/03/2020-06-03-zabbix%E5%8E%86%E5%8F%B2%E6%95%B0%E6%8D%AE%E6%B8%85%E7%90%86/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/touxiang.png">
      <meta itemprop="name" content="Emoh">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Just do it!">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/06/03/2020-06-03-zabbix%E5%8E%86%E5%8F%B2%E6%95%B0%E6%8D%AE%E6%B8%85%E7%90%86/" class="post-title-link" itemprop="url">2020-06-03-zabbix历史数据清理</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-03 11:39:15 / 修改时间：11:40:05" itemprop="dateCreated datePublished" datetime="2020-06-03T11:39:15+08:00">2020-06-03</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/zabbix/" itemprop="url" rel="index"><span itemprop="name">zabbix</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h1 id="ZABBIX历史数据清理"><a href="#ZABBIX历史数据清理" class="headerlink" title="ZABBIX历史数据清理"></a>ZABBIX历史数据清理</h1><ul>
<li>创建新表</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">create</span> <span class="keyword">table</span> history_new <span class="keyword">like</span> history;</span><br><span class="line"><span class="keyword">create</span> <span class="keyword">table</span> history_uint_new <span class="keyword">like</span> history_uint;</span><br><span class="line"><span class="keyword">create</span> <span class="keyword">table</span> history_text_new <span class="keyword">like</span> history_text;</span><br></pre></td></tr></table></figure>

<ul>
<li>将近期(一个月)的数据插入到新的表中</li>
</ul>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">insert</span> <span class="keyword">into</span> history_new <span class="keyword">select</span> * <span class="keyword">from</span> history <span class="keyword">where</span> clock &gt; <span class="string">'1459785600'</span>;</span><br><span class="line"><span class="keyword">insert</span> <span class="keyword">into</span> history_text_new <span class="keyword">SELECT</span> * <span class="keyword">FROM</span> history_text <span class="keyword">WHERE</span> clock &gt; <span class="string">'1461945600'</span>;</span><br><span class="line"><span class="keyword">insert</span> <span class="keyword">into</span> history_uint_new <span class="keyword">SELECT</span> * <span class="keyword">FROM</span> history_uint <span class="keyword">WHERE</span> clock &gt; <span class="string">'1461945600'</span>;</span><br></pre></td></tr></table></figure>

<blockquote>
<p>这里的clock是UNIX时间戳<br>这里根据数据量的大小可以能会花费好几个小时的时间</p>
</blockquote>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/06/03/2020-06-03-zabbix%E5%8E%86%E5%8F%B2%E6%95%B0%E6%8D%AE%E6%B8%85%E7%90%86/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://emoh.xyz/2020/06/03/2020-06-03-syslog%E9%85%8D%E7%BD%AE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/touxiang.png">
      <meta itemprop="name" content="Emoh">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Just do it!">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/06/03/2020-06-03-syslog%E9%85%8D%E7%BD%AE/" class="post-title-link" itemprop="url">2020-06-03-syslog配置</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-03 11:35:42 / 修改时间：11:37:42" itemprop="dateCreated datePublished" datetime="2020-06-03T11:35:42+08:00">2020-06-03</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/linux%E7%AE%A1%E7%90%86/" itemprop="url" rel="index"><span itemprop="name">linux管理</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <h1 id="syslog配置"><a href="#syslog配置" class="headerlink" title="syslog配置"></a>syslog配置</h1><ul>
<li>AIX</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">1、使用vi编辑/etc/hosts文件，写入日志服务器的IP和主机名：</span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> 172.10.5.3  syslogsrv &gt;&gt;/etc/hosts</span><br><span class="line"></span><br><span class="line">2、修改/etc/syslog.conf文件</span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> auth.info    @syslogsrv &gt;&gt; /etc/syslog.conf</span><br><span class="line"><span class="built_in">echo</span> <span class="string">"*.info;auth.none    @syslogsrv "</span> &gt;&gt; /etc/syslog.conf</span><br><span class="line"><span class="built_in">echo</span> <span class="string">"*.emerg    @syslogsrv "</span> &gt;&gt; /etc/syslog.conf</span><br><span class="line"><span class="built_in">echo</span> <span class="string">"local7.*    @syslogsrv "</span> &gt;&gt; /etc/syslog.conf</span><br><span class="line"></span><br><span class="line">3、重启syslog服务</span><br><span class="line"></span><br><span class="line">stopsrc -s syslogd</span><br><span class="line">startsrc -s syslogd</span><br></pre></td></tr></table></figure>

<hr>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/06/03/2020-06-03-syslog%E9%85%8D%E7%BD%AE/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  

      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://emoh.xyz/2020/06/01/2020-06-01-tmux%E5%BF%AB%E6%8D%B7%E9%94%AE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/touxiang.png">
      <meta itemprop="name" content="Emoh">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Just do it!">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">
          
            <a href="/2020/06/01/2020-06-01-tmux%E5%BF%AB%E6%8D%B7%E9%94%AE/" class="post-title-link" itemprop="url">tmux快捷键</a>
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2020-06-01 12:44:58 / 修改时间：12:47:44" itemprop="dateCreated datePublished" datetime="2020-06-01T12:44:58+08:00">2020-06-01</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/vim/" itemprop="url" rel="index"><span itemprop="name">vim</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
          <p>常用命令</p>
<p>tmux new 创建默认名称的会话（在tmux命令模式使用new命令可实现同样的功能，其他命令同理，后文不再列出tmux终端命令）</p>
<p>tmux new -s mysession 创建名为mysession的会话</p>
<p>tmux ls 显示会话列表</p>
<p>tmux a 连接上一个会话</p>
<p>tmux a -t mysession 连接指定会话</p>
<p>tmux rename -t s1 s2 重命名会话s1为s2</p>
<p>tmux kill-session 关闭上次打开的会话</p>
<p>tmux kill-session -t s1 关闭会话s1</p>
<p>tmux kill-session -a -t s1 关闭除s1外的所有会话</p>
<p>tmux kill-server 关闭所有会话</p>
          <!--noindex-->
            <div class="post-button">
              <a class="btn" href="/2020/06/01/2020-06-01-tmux%E5%BF%AB%E6%8D%B7%E9%94%AE/#more" rel="contents">
                阅读全文 &raquo;
              </a>
            </div>
          <!--/noindex-->
        
      
    </div>

    
    
    
      <footer class="post-footer">
        <div class="post-eof"></div>
      </footer>
  </article>
  
  
  


  
  <nav class="pagination">
    <span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><span class="space">&hellip;</span><a class="page-number" href="/page/5/">5</a><a class="extend next" rel="next" href="/page/2/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Emoh"
      src="/images/touxiang.png">
  <p class="site-author-name" itemprop="name">Emoh</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">29</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Emoh</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

</body>
</html>
